// 
// Decompiled by Procyon v0.5.36
// 

package com.akamai.botman;

import java.util.*;
import com.cyberfend.cyfsecurity.*;
import android.os.*;

final class aa implements java.util.Observer
{
    private final com.akamai.botman.y b;
    long a;
    
    aa() {
        this.a = 0L;
        this.b = new com.akamai.botman.y(this);
    }
    
    @java.lang.Override
    public final void update(final java.util.Observable observable, final java.lang.Object data) {
        try {
            final java.lang.Throwable[] array = new java.lang.Throwable[0];
            if (data == null) {
                if (a()) {
                    com.cyberfend.cyfsecurity.CYFMonitor.b().b();
                }
                if (com.akamai.botman.d.d && a()) {
                    com.akamai.botman.b.a(1);
                }
            }
            else {
                final com.akamai.botman.ab ab = (com.akamai.botman.ab)data;
                final com.akamai.botman.y b = this.b;
                final com.akamai.botman.ab ab2 = ab;
                final com.akamai.botman.y y = b;
                long a = 0L;
                final com.akamai.botman.aa aa;
                if ((aa = y.a.get()) != null) {
                    a = aa.a;
                }
                y.e = ab2.a.getPointerCount();
                if (ab2.c == 1) {
                    y.d = 0;
                    while (y.d < y.e) {
                        if (android.os.Build$VERSION.SDK_INT >= 14) {
                            y.b = ab2.a.getToolType(y.d);
                        }
                        else {
                            y.b = -1;
                        }
                        y.c = ab2.b + "," + (ab2.a.getEventTime() - a) + ",0,0," + ab2.a.getPointerCount() + ",1," + y.b + ",-1;";
                        com.akamai.botman.e.a += y.c;
                        com.akamai.botman.e.b += ab2.a.getEventTime() - a + ab2.b;
                        ++com.akamai.botman.e.e;
                        final com.akamai.botman.y y2 = y;
                        ++y2.d;
                    }
                }
                else {
                    if (android.os.Build$VERSION.SDK_INT >= 14) {
                        y.b = ab2.a.getToolType(ab2.a.getActionIndex());
                    }
                    else {
                        y.b = -1;
                    }
                    y.c = ab2.b + "," + (ab2.a.getEventTime() - a) + ",0,0," + ab2.a.getPointerCount() + ",1," + y.b + ",-1;";
                    com.akamai.botman.e.a += y.c;
                    com.akamai.botman.e.b = com.akamai.botman.e.b + (ab2.a.getEventTime() - a) + ab2.b;
                    ++com.akamai.botman.e.f;
                }
                new java.lang.StringBuilder("Count: ").append(com.akamai.botman.e.j).append(", Touch String ").append(y.c);
                final java.lang.Throwable[] array2 = new java.lang.Throwable[0];
                this.a = ab.a.getEventTime();
            }
        }
        catch (java.lang.Exception ex) {
            com.akamai.botman.al.b("TouchManager", "Exception in processing touch event", ex);
            com.akamai.botman.f.a(ex);
        }
    }
    
    private static boolean a() {
        return com.akamai.botman.e.j == 1L || com.akamai.botman.e.j == 6L || (com.akamai.botman.e.j > 6L && (com.akamai.botman.e.j - 6L) % 10L == 0L);
    }
}
